<template>
    <div class="home">
      <div class="anti_">
        <img :src="timg" ref="img_" alt="" class="el_img hige"/>
        <input ref="list" @change="onFileChange($event)" type='file' name="thumbnail"
               accept='image/jpeg image/x-png'   class=" pic_add hige"/>
      </div>
    </div>
</template>
<script>
  import {
    mapGetters
  } from 'vuex'
  import timg from  "~/timg.jpg";
  export default {
    props: {
      ImgPathName:{
        type:String
      },
      ImgID:{
        type:String
      }
    },
    components: {
      mapGetters
    },
    data() {
      return {
        timg,
        input_e:'',
        // IDTRACING:this.$ENV.TRACING,
      }
    },
    methods: {


      onFileChange(e){
        if(this.$oneselfFn.IMAGEVAL(e)){
          this.input_e = e;                       //delete()
          this.$img.SetParm(this.$ENV.TRACING+this.ImgID+this.ImgPathName,e).create().then((res)=>{
            console.info(res);
            this.timg = res.imageURL+'/'+res.imagePath;
          })
            .catch((err)=>{
              if(err.code){
                this.$message.error(err.Massage);
              }
            })
        }else {
          this.$notify({
            title: '警告',
            message: '图片大小不能超过2M',
            type: 'warning'
          })
        }

      },
      addimage(){},
    },
    watch: {},
    computed: {
      addimg(){
        return this.$refs.InputConment
      },
      ...mapGetters([
        'qiyeenterprise',
      ]),
    },
    created() {

    },
    mounted() {
     if(this.qiyeenterprise.id){

     }
      //生命周期
    }
  }
</script>
<style scoped>
    .home {
        width: 100%;
        height: 100%;
    }
    .anti_ {
      margin: auto;
      width: 50%;
      height: 200px;
    }

    .anti_ img {
      width: 100%;
      display: block;
      background-size: 100% 100%;
    }
    .hige{
      height: 160px;
    }
    .pic_add {
      width: 100%;
      position: relative;
      bottom: 160px;
      z-index: 9999;
      opacity: 0;
    }

</style>
